<template>
  <div class="creatoritem">
    <div class="item" v-for="i in list" :key="i.id" @click="onClick(i.id)">
      <img :src="i.avatar" alt="" />
      <div class="user">
        <span class="username">{{ i.username }}</span>
        <span class="fans"
          >{{ i.occupation }} · 粉丝{{ i.count.count_follower }}</span
        >
      </div>
      <div class="guanzhu">关注</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    list: Array,
  },
  methods:{
    onClick(id){
      this.$router.push({path:"/userpage",query:{id:id}})
    }
  }
};
</script>

<style lang="less" scoped>
.creatoritem {
  .item {
    height: 80px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f7f7f7;
    img {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      margin-right:10px ;
    }
    .user {
        display: flex;
        flex-direction: column;
        flex: 1;
      .username {
        font-size: 15px;
        font-weight: 600;
      }
      .fans{
          font-size: 12px;
          color: #aaa;
      }
    }
    .guanzhu {
      width: 80px;
      height: 30px;
      padding: 5px 15px;
      border-radius: 26px;
      font-weight: 500;
      text-align: center;
      color: #e76961;
      background-color: #fbeee8;
    }
  }
}
</style>